/**
 * web 平台
 */
import { IPlatform } from "./IPlatform";
import { DeviceModel, DeviceType, PlatformType } from "./PlatformType";

export default class WebPlatform implements IPlatform {

    readonly deviceType: DeviceType;
    readonly deviceModel: DeviceModel;
    readonly appId: string = "web";

    readonly platType: number = PlatformType.web;

    getVersion(): string {
        return "1.0.1";
    }

    pay(payinfo: Object): Promise<any> {
        throw new Error("Method not implemented.");
    }
    login(): Promise<{ code: number; data: any; }> {
        throw new Error("Method not implemented.");
    }
    onHide(cb: Function): void {
    }
    onShow(cb: Function): void {
    }
    showAd(param: string): Promise<number> {
        throw new Error("Method not implemented.");
    }

    shareApp(param: any): void {
        throw new Error("Method not implemented.");
    }
    
    setItem(key: string, v: any): void {
        Laya.LocalStorage.setItem(key, v);
    }

    getItem(key: string) {
        return Laya.LocalStorage.getItem(key);
    }

    deleteItem(key: string): void {
        Laya.LocalStorage.removeItem(key);
    }

    getNetworkType(call?: (type: string) => void): void {
        throw new Error("Method not implemented.");
    }
    vibrateShort(): void {
        throw new Error("Method not implemented.");
    }
    vibrateLong(): void {
        throw new Error("Method not implemented.");
    }
    exit(): void {
        throw new Error("Method not implemented.");
    }


}